import request from '@/utils/request'
export function getShopList(data) {
  return request({
    url: `http://192.168.32.29:3000/shoplist?_page=${data.page}&_limit=${data.pagesize}`,
    method: 'get'
  })
}
/**
 * 删除商铺
 */
export function delShop(id) {
  return request({
    url: `http://192.168.32.29:3000/shoplist/${id}`,
    method: 'delete'

  })
}
/**
 * 修改商铺
 */
export function edit(data) {
  return request({
    url: `http://192.168.32.29:3000/shoplist/${data.id}`,
    data,
    method: 'patch'
  })
}
/**
 * 获取行业分类
 */
export function getIndustry() {
  return request({
    method: 'get',
    url: 'http://192.168.32.29:3000/industryInvolved'
  })
}
/**
 * 新增商铺
 */
export function addShop(data) {
  return request({
    method: 'post',
    url: 'http://192.168.32.29:3000/shoplist',
    data
  })
}
/**
 * 按行业来查询
 */
export function queryIndustry(params) {
  return request({
    method: 'get',
    url: 'http://192.168.32.29:3000/shoplist',
    params
  })
}
/**
 * 获取权益级别
 */
export function equities() {
  return request({
    method: 'get',
    url: 'http://192.168.32.29:3000/shopEquities'
  })
}
/**
 * 获取所有商品
 */
export function getGoodsList() {
  return request({
    method: 'get',
    url: 'http://192.168.32.29:3000/goodsList'
  })
}
/**
 * 获取商品分类
 */
export function getGoodsType() {
  return request({
    method: 'get',
    url: 'http://192.168.32.29:3000/goodsType'
  })
}
/**
 * 删除某一行商品
 */
export function delGoods(id) {
  return request({
    method: 'delete',
    url: `http://192.168.32.29:3000/goodsList/${id}`
  })
}
/**
 * 修改某一行商品
 */
export function editGoodsOfRow(data) {
  return request({
    method: 'patch',
    url: `http://192.168.32.29:3000/goodsList/${data.id}`,
    data
  })
}
/**
 * 新增商品
 */
export function addGoods(params) {
  return request({
    method: 'post',
    url: 'http://192.168.32.29:3000/goodsList',
    params
  })
}
